Skip to content

TerminalShell (Linux): better support for Ghostty #1803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

apocelipes
Copy link
Contributor

@apocelipes apocelipes commented Jun 12, 2025

Changes:

  • Remove the suffix from the Ghostty version string on Arch Linux, which is not present in other distributions or macOS.

Ghostty does not support Windows (still WIP at an early stage), so only *nix parts modified.

getenv("GHOSTTY_RESOURCES_DIR") != NULL ||
getenv("GHOSTTY_SHELL_INTEGRATION_NO_SUDO") != NULL ||
getenv("GHOSTTY_BIN_DIR") != NULL
) term = "Ghostty";
Copy link
Member

@CarterLi CarterLi Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ghostty reports $TERM_PROGRAM, so additional env-var checks are not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Removed.

@apocelipes apocelipes force-pushed the feat-ghostty branch 2 times, most recently from da1096c to 535c877 Compare June 14, 2025 20:19
@apocelipes
Copy link
Contributor Author

Ubuntu:
ubuntu
ubuntu2

Arch Linux:
archlinux1
archlinux2

@apocelipes apocelipes force-pushed the feat-ghostty branch 2 times, most recently from d6fd359 to 16373f4 Compare June 17, 2025 08:46
@apocelipes apocelipes changed the title TerminalShell: better support for Ghostty TerminalShell (Linux): better support for Ghostty Jun 17, 2025
@apocelipes
Copy link
Contributor Author

Rebased. Commit message has been updated.

@CarterLi
Copy link
Member

Hello. Please reply my comments first.

@apocelipes
Copy link
Contributor Author

Hello. Please reply my comments first.

I'm sorry, I didn't see it, could you quote-reply the comment and @ me?

I only saw this and replied:
image

@apocelipes
Copy link
Contributor Author

Hello. Please reply my comments first.

I'm sorry, I didn't see it, could you quote-reply the comment and @ me?

I only saw this and replied: image

@CarterLi

@apocelipes
Copy link
Contributor Author

@CarterLi So, where is your comment? Could you paste a screenshot like what I did?

Copy link
Member

@CarterLi CarterLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review these comments

if(version->length > 0) return true;
}

if(!getExeVersionRaw(exe, version)) return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually dont think this is needed. As $TERMINAL_PROGRAM_VERSION exists.
We rely on it for some other terminals too, such as Wezterm, iTerm and warp.

Note we always add another detection method after ffBinaryExtractStrings usage, as ffBinaryExtractStrings relies on the internal implementation of terminals which is not very reliable. While $TERMINAL_PROGRAM_VERSION is considerred a public API; if the variable is not there it is a terminal bug.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (env)
{
ffStrbufAppendS(version, env);
// 1.1.3-arch1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI fedora version also includes .fc42. Lets keep as it was.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

For nightly version, ghostty --version includes the branch name and commit hash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kernel version contains archlinux specific suffix -arch1-1. I don't think it's problematic. Do you?

@CarterLi
Copy link
Member

Can you see it now?

@apocelipes
Copy link
Contributor Author

Can you see it now?

Thanks, I can see it now. Maybe it's Github's bug that it didn't display to me.

@apocelipes
Copy link
Contributor Author

The version suffix doesn't indicate a change in the program code, sometimes the suffix changes simply by packager recompiling it. Many other programs don't have the suffix in their versions output, such as bash (usually this is a side effect of the formatting), so I'm considering whether or not to remove ghostty's version suffix just the same.

But since Fedora also has a version suffix, I think it's okay to keep it.

I'll close this PR. Thanks for your review.

@apocelipes apocelipes closed this Jun 24, 2025
@apocelipes apocelipes deleted the feat-ghostty branch June 24, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants